home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-3.98 / gdb / configure < prev    next >
Encoding:
Text File  |  1991-08-01  |  20.3 KB  |  738 lines

  1. #!/bin/sh
  2. # Please do not edit this file.  It is generated automatically from
  3. # configure.in and a configure template.
  4. configdirs=
  5.  
  6. #!/bin/sh
  7.  
  8. # Configuration script template
  9. #   Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
  10.  
  11. #This file is part of GNU.
  12.  
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version.
  17. # This program is distributed in the hope that it will be useful,
  18. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. # GNU General Public License for more details.
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. # $Id: configure,v 1.22 1991/07/20 01:22:30 rich Exp $
  26.  
  27. #
  28. # Shell script to create proper links to machine-dependent files in
  29. # preparation for compilation.
  30. #
  31. # If configure succeeds, it leaves its status in config.status.
  32. # If configure fails after disturbing the status quo, 
  33. #     config.status is removed.
  34. #
  35.  
  36. remove=rm
  37. hard_link=ln
  38. symbolic_link='ln -s'
  39.  
  40. #for Test
  41. #remove="echo rm"
  42. #hard_link="echo ln"
  43. #symbolic_link="echo ln -s"
  44.  
  45. progname=$0
  46.  
  47. # clear some things potentially inherited from environment.
  48. ansi=
  49. defaulttargets=
  50. destdir=
  51. fatal=
  52. hostsubdir=
  53. Makefile=Makefile
  54. Makefile_in=Makefile.in
  55. norecurse=
  56. removing=
  57. srcdir=
  58. srctrigger=
  59. target=
  60. targets=
  61. targetsubdir=
  62. template=
  63. verbose=
  64.  
  65. for arg in $*;
  66. do
  67.     case ${arg} in
  68.     -ansi | +ansi)
  69.         ansi=true
  70.         ;;
  71.     -destdir=* | +destdir=* | +destdi=* | +destd=* | +dest=* | +des=* | +de=* | +d=*)
  72.         destdir=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
  73.         ;;
  74.     -forcesubdirs | +forcesubdirs | +forcesubdir | +forcesubdi | +forcesubd \
  75.     | +forcesub | +forcesu | +forces | +force | +forc | +for | +fo | +f)
  76.         forcesubdirs=${arg}
  77.         ;;
  78.     -languages=* | +languages=* | +language=* | +languag=* \
  79.         | +langua=* | +langu=* | +lang=* | +lan=* | +la=* \
  80.         | +l=*)
  81.         languages="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
  82.         ;;
  83.     -gas | +gas | +ga | +g)
  84.         gas=yes
  85.         ;;
  86.     -help | +h | +help)
  87.         fatal=true
  88.         ;;
  89.     -nfp | +nfp | +nf | +n)
  90.         nfp=yes
  91.         ;;
  92.     -norecurse | +norecurse)
  93.         norecurse=true
  94.         ;;
  95.     -rm | +rm)
  96.         removing=${arg}
  97.         ;;
  98. #    -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
  99. #        srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
  100. #        ;;
  101.     -target=* | +target=* | +targe=* | +targ=* | +tar=* | +ta=* | +t=*)
  102.         if [ -n "${targets}" ] ; then
  103.             forcesubdirs="+forcesubdirs"
  104.         fi
  105.  
  106.         newtargets="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
  107.         targets="${newtargets}"
  108.         ;;
  109.     -template=* | +template=*)
  110.         template=`echo ${arg} | sed 's/[+-]template=//'`
  111.         ;;
  112.     +verbose | +verbos | +verbo | +verb | +ver | +ve | +v)
  113.         verbose=${arg}
  114.         ;;
  115.     -* | +*)
  116.         (echo ;
  117.         echo "Unrecognized option: \"${arg}\"". ;
  118.         echo) 1>&2
  119.         fatal=true
  120.         ;;
  121.     *)
  122.         if [ -n "${hosts}" ] ; then
  123.             forcesubdirs="+forcesubdirs"
  124.         fi
  125.  
  126.         newhosts="${hosts} ${arg}"
  127.         hosts=${newhosts}
  128.         ;;
  129.     esac
  130. done
  131.  
  132. if [ -n "${verbose}" ] ; then
  133.     echo `pwd`/configure $*
  134.     echo targets=\"${targets}\"
  135. fi
  136.  
  137. # process host and target only if not rebuilding configure itself or removing.
  138. if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
  139.     # Complain if an arg is missing
  140.     if [ -z "${hosts}" ] ; then
  141.         (echo ;
  142.         echo "configure: No HOST specified." ;
  143.         echo) 2>&1
  144.         fatal=true
  145.     fi
  146. fi
  147.  
  148. if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
  149.     (echo "Usage: configure HOST" ;
  150.     echo ;
  151.     echo "Options: [defaults in brackets]" ;
  152.     echo " +ansi        configure w/ANSI library. [no ansi lib]" ;
  153.     echo " +destdir=MYDIR    configure for installation into MYDIR. [/usr/local]" ;
  154.     echo " +forcesubdirs    configure in subdirectories.  [in source directories]" ;
  155.     echo " +lang=LANG    configure to build LANG. [gcc]" ;
  156.     echo " +help        print this message. [normal config]" ;
  157.     echo " +gas        configure the compilers for use with gas. [native as]" ;
  158.     echo " +nfp        configure the compilers default to soft floating point. [hard float]" ;
  159.     echo " +norecurse    configure this directory only. [recurse]" ;
  160.     echo " +rm        remove this configuration. [build a configuration]" ;
  161.     echo " +target=TARGET    configure for TARGET.  [TARGET = HOST]" ;
  162.     echo " +template=TEM    rebuild configure using TEM. [normal config]" ;
  163.     echo ;
  164.     echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
  165.     echo "Asking for more than one \"+target\" implies \"+forcesubdirs\".  Any other" ;
  166.     echo "options given will apply to all targets.") 1>&2
  167.  
  168.     if [ -r config.status ] ; then
  169.         cat config.status
  170.     fi
  171.  
  172.     exit 1
  173. fi
  174.  
  175. #### configure.in common parts come in here.
  176. srcname="GDB"
  177. srctrigger=main.c
  178.  
  179. ## end of common part.
  180.  
  181. # are we rebuilding config itself?
  182. if [ -n "${template}" ] ; then
  183.     if [ ! -r ${template} ] ; then
  184.         echo "Can't find template ${template}."
  185.         exit 1
  186.     fi
  187.  
  188. # prep the template
  189.     sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
  190. #### configure.in common parts come in here.\
  191. ## end of common part.' \
  192.     -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
  193. #### configure.in per-host parts come in here.\
  194. ## end of per-host part.' \
  195.     -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
  196. #### configure.in per-target parts come in here.\
  197. ## end of per-target part.' \
  198.     -e '/^#### configure.in post-target parts come in here.$/,/^## end of post-target part.$/c\
  199. #### configure.in post-target parts come in here.\
  200. ## end of post-target part.' \
  201.     < ${template} > template.new
  202.  
  203.     if [ -r configure.in ] ; then
  204.         if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
  205.             echo `pwd`/configure.in has no "per-host:" line.
  206.             exit 1
  207.         fi
  208.  
  209.         if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
  210.             echo `pwd`/configure.in has no "per-target:" line.
  211.             exit 1
  212.         fi
  213.  
  214.         # split configure.in into common, per-host, per-target,
  215.         # and post-target parts.  Post-target is optional.
  216.         sed -e '/^# per\-host:/,$d' configure.in > configure.com
  217.         sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > configure.hst
  218.         if grep -s '^# post-target:' configure.in ; then
  219.           sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > configure.tgt
  220.           sed -e '1,/^# post\-target:/d' configure.in > configure.pos
  221.         else
  222.           sed -e '1,/^# per\-target:/d' configure.in > configure.tgt
  223.           echo >configure.pos
  224.         fi
  225.  
  226.         # and insert them
  227.         sed -e '/^#### configure.in common parts come in here.$/  r configure.com' \
  228.             -e '/^#### configure.in per\-host parts come in here.$/  r configure.hst' \
  229.             -e '/^#### configure.in per\-target parts come in here.$/  r configure.tgt' \
  230.             -e '/^#### configure.in post\-target parts come in here.$/  r configure.pos' \
  231.             template.new > configure.new
  232.  
  233.         rm -f configure.com configure.tgt configure.hst configure.pos
  234.     else
  235.         echo Warning: no configure.in in `pwd`
  236.         cat ${template} >> configure
  237.     fi
  238.  
  239.     chmod a+x configure.new
  240.     rm template.new
  241. #    mv configure configure.old
  242.     mv configure.new configure
  243.     echo Rebuilt configure in `pwd`
  244.  
  245.     if [ -z "${norecurse}" ] ; then
  246.         # If template is relative path, make it absolute for recursing.
  247.         if echo "${template}" | grep -s '^/' ; then
  248.            true
  249.         else
  250.            template=`pwd`/${template}
  251.         fi
  252.  
  253.         while [ -n "${configdirs}" ] ; do
  254.             # set configdir to car of configdirs, configdirs to cdr of configdirs
  255.             set ${configdirs}; configdir=$1; shift; configdirs=$*
  256.  
  257.             if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
  258.                 targetspecificdirs=${configdir}.*
  259.             else
  260.                 targetspecificdirs=
  261.             fi
  262.  
  263.             for i in ${configdir} ${targetspecificdirs} ; do
  264.                 if [ -d $i ] ; then
  265.                     if [ -r $i/configure ] ; then
  266.                         (cd $i ;
  267.                             ./configure +template=${template} ${verbose})
  268.                     else
  269.                         echo No configure script in `pwd`/$i
  270.                     fi
  271.                 else
  272.                     echo Warning: directory $i is missing.
  273.                 fi
  274.             done
  275.         done
  276.     fi
  277.  
  278.     exit 0
  279. fi
  280.  
  281. # some sanity checks on configure.in
  282. if [ -z "${srctrigger}" ] ; then
  283.     echo srctrigger not set in configure.in. `pwd` not configured.
  284.     exit 1
  285. fi
  286.  
  287. for host in ${hosts} ; do
  288.     # Default other arg
  289.     if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
  290.         targets=${host}
  291.         defaulttargets=true
  292.     fi
  293.  
  294.     host_makefile_frag=config/hmake-${host}
  295.  
  296. #### configure.in per-host parts come in here.
  297.  
  298. if [ ! -f xconfig/${host} ]; then
  299.     echo "No such host ${host}"
  300.     exit 1
  301. fi
  302.  
  303. #  We really shouldn't depend on there being a space after XM_FILE= ...
  304. hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <xconfig/$host`
  305.  
  306. ## end of per-host part.
  307.  
  308.  
  309.     for target in ${targets} ; do
  310.  
  311.         if [ -n "${verbose}" ] ; then
  312.             echo "    target=\"${target}\""
  313.         fi
  314.  
  315.         target_makefile_frag=config/tmake-${target}
  316.  
  317. #### configure.in per-target parts come in here.
  318.  
  319. if [ ! -f tconfig/${target} ]; then
  320.     echo "No such target ${target}"
  321.     exit 1
  322. fi
  323.  
  324. if [ -z "${removing}" ] ; then
  325.     cat xconfig/${host} tconfig/${target} | awk '$1 == "#msg" {
  326.         print substr($0,6)}'
  327. fi
  328.  
  329. #  We really shouldn't depend on there being a space after TM_FILE= ...
  330. targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <tconfig/$target`
  331.  
  332. host_makefile_frag=xconfig/${host}
  333. target_makefile_frag=tconfig/${target}
  334.  
  335. # If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the
  336. # ?config/* file, we don't make the corresponding links.  But we have
  337. # to remove the xm.h files and tm.h files anyway, e.g. when switching
  338. # from "configure host" to "configure none".
  339. files=
  340. links=
  341. rm -f xm.h
  342. if [ "${hostfile}" != "" ]; then
  343.     files="${files} ${hostfile}"
  344.     links="${links} xm.h"
  345. fi
  346. rm -f tm.h
  347. if [ "${targetfile}" != "" ]; then
  348.     files="${files} ${targetfile}"
  349.     links="${links} tm.h"
  350. fi
  351.  
  352. ## end of per-target part.
  353.  
  354.         # Temporarily, we support only direct subdir builds.
  355.         hostsubdir=Host-${host}
  356.         targetsubdir=Target-${target}
  357.  
  358.         if [ -n "${removing}" ] ; then
  359.             if [ -n "${forcesubdirs}" ] ; then
  360.                 if [ -d "${hostsubdir}" ] ; then
  361.                     rm -rf ${hostsubdir}/${targetsubdir}
  362.  
  363.                     if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
  364.                         rm -rf ${hostsubdir}
  365.                     fi
  366.                 else
  367.                     echo Warning: no `pwd`/${hostsubdir} to remove.
  368.                 fi
  369.             else
  370.                 rm -f ${Makefile} config.status ${links}
  371.             fi
  372.         else
  373.             if [ -n "${forcesubdirs}" ] ; then
  374.                 # check for existing status before allowing forced subdirs.
  375.                 if [ -f ${Makefile} ] ; then
  376.                     echo "${Makefile} already exists in source directory.  `pwd` not configured."
  377.                     exit 1
  378.                 fi
  379.  
  380.                 if [ ! -d ${hostsubdir} ] ; then mkdir ${hostsubdir} ; fi
  381.                 cd ${hostsubdir}
  382.  
  383.                 if [ ! -d ${targetsubdir} ] ; then mkdir ${targetsubdir} ; fi
  384.                 cd ${targetsubdir}
  385.  
  386.                 srcdir=../..
  387.             else
  388.                 # if not subdir builds, then make sure none exist.
  389.                 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
  390.                     echo "Configured subdirs exist.  `pwd` not configured."
  391.                     exit 1
  392.                 fi
  393.             fi
  394.  
  395.             # Find the source files, if location was not specified.
  396.             if [ -z "${srcdir}" ] ; then
  397.                 srcdirdefaulted=1
  398.                 srcdir=.
  399.                 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
  400.                     srcdir=..
  401.                 fi
  402.             fi
  403.  
  404.             if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
  405.                 if [ -z "${srcdirdefaulted}" ] ; then
  406.                     echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
  407.                 else
  408.                     echo "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
  409.                 fi
  410.  
  411.                 echo \(At least ${srctrigger} is missing.\) 1>&2
  412.                 exit 1
  413.             fi
  414.  
  415.             # Set up the list of links to be made.
  416.             # ${links} is the list of link names, and ${files} is the list of names to link to.
  417.  
  418.             # Make the links.
  419.             while [ -n "${files}" ] ; do
  420.                 # set file to car of files, files to cdr of files
  421.                 set ${files}; file=$1; shift; files=$*
  422.                 set ${links}; link=$1; shift; links=$*
  423.  
  424.                 if [ ! -r ${srcdir}/${file} ] ; then
  425.                     echo "${progname}: cannot create a link \"${link}\"," 1>&2
  426.                     echo "since the file \"${file}\" does not exist." 1>&2
  427.                     exit 1
  428.                 fi
  429.  
  430.                 ${remove} -f ${link}
  431.                 rm -f config.status
  432.                 # Make a symlink if possible, otherwise try a hard link
  433.                 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
  434.  
  435.                 if [ ! -r ${link} ] ; then
  436.                     echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
  437.                     exit 1
  438.                 fi
  439.                 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
  440.             done
  441.  
  442.             # Create a .gdbinit file which runs the one in srcdir
  443.             # and tells GDB to look there for source files.
  444.  
  445.             case ${srcdir} in
  446.             .)
  447.                 ;;
  448.             *)
  449.                 echo "dir ." > .gdbinit
  450.                 echo "dir ${srcdir}" >> .gdbinit
  451.                 echo "source ${srcdir}/.gdbinit" >> .gdbinit
  452.                 ;;
  453.             esac
  454.  
  455.             # Install a makefile, and make it set VPATH
  456.             # if necessary so that the sources are found.
  457.             # Also change its value of srcdir.
  458.  
  459.         # FIXME-someday: This business of always writing to .tem and mv back
  460.         # is so that I don't screw things up while developing.  Once this
  461.         # template is stable, these should be optimized. xoxorich.
  462.  
  463.             # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
  464.             if [ "${host}" != "${target}" ] ; then
  465.                 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
  466.                 echo "ALL=start.encap" >> ${Makefile}
  467.             else
  468.                 echo "ALL=all.internal" > ${Makefile}
  469.             fi
  470.  
  471.             # set target, host, VPATH
  472.             echo "host = ${host}" >> ${Makefile}
  473.             echo "target = ${target}" >> ${Makefile}
  474.  
  475.             if [ -n "${forcesubdirs}" ] ; then
  476.                 echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile}
  477.             else
  478.                 echo "subdir =" >> ${Makefile}
  479.             fi
  480.  
  481.         #    echo "workdir = `pwd`" >> ${Makefile}
  482.             echo "VPATH = ${srcdir}" >> ${Makefile}
  483.  
  484.             # add "Makefile.in" (or whatever it's called)
  485.             cat ${srcdir}/${Makefile_in} >> ${Makefile}
  486.  
  487.             # Conditionalize the makefile for this host.
  488.             if [ -f ${srcdir}/${host_makefile_frag} ] ; then
  489.                 sed -e "/^####/  r ${srcdir}/${host_makefile_frag}" ${Makefile} > Makefile.tem
  490.                 mv Makefile.tem ${Makefile}
  491.             fi
  492.  
  493.             # Conditionalize the makefile for this target.
  494.             if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  495.                 sed -e "/^####/  r ${srcdir}/${target_makefile_frag}" ${Makefile} > Makefile.tem
  496.                 mv Makefile.tem ${Makefile}
  497.             fi
  498.  
  499.             # set srcdir
  500.             sed "s@^srcdir = \.@srcdir = ${srcdir}@" ${Makefile} > Makefile.tem
  501.             mv Makefile.tem ${Makefile}
  502.  
  503.             # set destdir
  504.             if [ -n "${destdir}" ] ; then
  505.                 sed "s:^destdir =.*$:destdir = ${destdir}:" ${Makefile} > Makefile.tem
  506.                 mv Makefile.tem ${Makefile}
  507.             fi
  508.  
  509.             # reset SUBDIRS
  510.             sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" ${Makefile} > Makefile.tem
  511.             mv Makefile.tem ${Makefile}
  512.  
  513.             # reset NONSUBDIRS
  514.             sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" ${Makefile} > Makefile.tem
  515.             mv Makefile.tem ${Makefile}
  516.  
  517.             using=
  518.             if [ -f ${srcdir}/${host_makefile_frag} ] ; then
  519.                 using=" using \"${host_makefile_frag}\""
  520.             fi
  521.  
  522.             if [ -f ${srcdir}/${target_makefile_frag} ] ; then
  523.                 if [ -z "${using}" ] ; then
  524.                     andusing=" using \"${target_makefile_frag}\""
  525.                 else
  526.                     andusing="${using} and \"${target_makefile_frag}\""
  527.                 fi
  528.             else
  529.                 andusing=${using}
  530.             fi
  531.  
  532.             echo "Created \"${Makefile}\"" in `pwd`${andusing}.
  533.  
  534. #### configure.in post-target parts come in here.
  535.  
  536. case ${srcdir} in
  537.   .)
  538.     ;;
  539.   *)
  540.     grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \
  541.       echo "source ${srcdir}/.gdbinit" >> .gdbinit
  542. esac
  543.  
  544. cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile
  545. ## end of post-target part.
  546.  
  547.             if [ "${host}" = "${target}" ] ; then
  548.                 echo "Links are now set up for use with a ${target}." \
  549.                     > config.status
  550.         #            | tee ${srcdir}/config.status
  551.             else
  552.                 echo "Links are now set up for host ${host} and target ${target}." \
  553.                     > config.status
  554.         #            | tee ${srcdir}/config.status
  555.             fi
  556.  
  557.             originaldir=`pwd`
  558.             cd ${srcdir}
  559.         fi
  560.     done # for each target
  561.  
  562. #    # Now build a Makefile for this host.
  563. #    if [ -n "${forcesubdirs}" ] ; then
  564. #        cd ${hostsubdir}
  565. #        cat > GNUmakefile << E!O!F
  566. ## Makefile generated by configure for host ${host}.
  567. #
  568. #%:
  569. #    for i in ${targets} ; do \
  570. #        $(MAKE) -C Target-\$i \$@
  571. #
  572. #all clean stage1 stage2 stage3 stage4etags tags TAGS
  573. #E!O!F
  574. #    fi
  575. done # for each host
  576.  
  577. # If there are subdirectories, then recurse. 
  578.  
  579. if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi
  580.  
  581. # configdirs is not null
  582. for configdir in ${configdirs} ; do
  583.     echo Configuring ${configdir}...
  584.     specifics=
  585.     commons=
  586.  
  587.     if [ -n "${defaulttargets}" ] ; then
  588.         for host in ${hosts} ; do
  589.             if [ -d ${configdir}.${host} ] ; then
  590.                 newspecifics="${specifics} ${host}"
  591.                 specifics=${newspecifics}
  592.             else
  593.                 newcommons="${commons} ${host}"
  594.                 commons=${newcommons}
  595.             fi # if target specific
  596.         done # for each host
  597.  
  598.         if [ -n "${commons}" ] ; then
  599.             if [ -d ${configdir} ] ; then
  600.                 (cd ${configdir} ;
  601.                     ./configure ${commons} ${verbose} ${forcesubdirs} ${removing} +destdir=${destdir}) \
  602.                     | sed 's/^/    /'
  603.             else
  604.                 echo Warning: directory \"${configdir}\" is missing.
  605.             fi
  606.         fi # if any common hosts
  607.  
  608.         if [ -n "${specifics}" ] ; then
  609.             for host in ${specifics} ; do
  610.                 echo Configuring target specific directory ${configdir}.${host}...
  611.                 (cd ${configdir}.${host} ;
  612.                     ./configure ${host} ${verbose} ${forcesubdirs} ${removing} +destdir=${destdir}) \
  613.                     | sed 's/^/    /'
  614.             done # for host in specifics
  615.         fi # if there are any specifics
  616.     else
  617.  
  618.         for target in ${targets} ; do
  619.             if [ -d ${configdir}.${target} ] ; then
  620.                 newspecifics="${specifics} ${target}"
  621.                 specifics=${newspecifics}
  622.             else
  623.                 newcommons="${commons} +target=${target}"
  624.                 commons=${newcommons}
  625.             fi
  626.  
  627.         done # check for target specific dir override
  628.  
  629.         if [ -n "${verbose}" ] ; then
  630.             echo "    "commons=\"${commons}\"
  631.             echo "    "specifics=\"${specifics}\"
  632.         fi # if verbose
  633.  
  634.         if [ -n "${commons}" ] ; then
  635.             if [ -d ${configdir} ] ; then
  636.                 (cd ${configdir} ;
  637.                     ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} \
  638.                         ${commons} +destdir=${destdir}) \
  639.                     | sed 's/^/    /'
  640.             else
  641.                 echo Warning: directory \"${configdir}\" is missing.
  642.             fi
  643.         fi # if any commons
  644.  
  645.         if [ -n "${specifics}" ] ; then
  646.             for target in ${specifics} ; do
  647.                 echo Configuring target specific directory ${configdir}.${target}...
  648.                 (cd ${configdir}.${target} ;
  649.                     ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} \
  650.                         "+target=${target}" +destdir=${destdir}) \
  651.                     | sed 's/^/    /'
  652.             done
  653.         fi # if any specifics
  654.     fi # not default targets
  655. done
  656.  
  657. exit 0
  658.  
  659. #
  660. # $Log: configure,v $
  661. # Revision 1.22  1991/07/20  01:22:30  rich
  662. # propogate gdb changes and destdir fix
  663. #
  664. # Revision 1.21  1991/07/20  00:55:20  gnu
  665. # Roll in new configure that handles GDB.  Make sure that the "configure"
  666. # that is checked-in reflects the latest "configure.in", which includes gdb.
  667. #
  668. # Revision 1.9  1991/07/06  04:35:51  gnu
  669. # Fix bug in configure when iterating targets.
  670. # Depend on alldeps.mak, not ${srcdir}/alldeps.mak, so it can be found
  671. # in either spot.
  672. #
  673. # Revision 1.8  1991/07/05  00:04:58  gnu
  674. # Thu Jul  4 14:47:06 1991  John Gilmore  (gnu at cygint.cygnus.com)
  675. #
  676. #         * configure.in, Makefile.in:  Avoid rebuilding "depend" as much.
  677. #         Avoid declaring Makefile dependencies, because GNU Make stupidly
  678. #         tries to update it if we do.
  679. #
  680. #         * coffread.c:  Revise for minor changes to bfd internal coff
  681. #         indexes.
  682. #
  683. #         * configure:  If -template= is given a relative path, make it
  684. #         absolute before recurring in subdirectories.
  685. #
  686. # Revision 1.7  1991/07/04  15:59:46  gnu
  687. # Make gdb work with configure.  Only thing that doesn't work is the -list
  688. # option (as far as I know).
  689. #
  690. # Revision 1.6  1991/06/04  07:28:16  gnu
  691. # Change GDB over to GNU General Public License version 2.
  692. #
  693. # Revision 1.5  1991/05/19  07:26:54  rich
  694. # configure changes and -opcode.h movement.
  695. #
  696. # Revision 1.4  1991/05/19  00:16:45  rich
  697. # Configure for gdb.
  698. #
  699. # Revision 1.10  1991/05/04  00:58:38  rich
  700. # Fix program name bug.
  701. #
  702. # Revision 1.9  1991/05/03  19:14:18  rich
  703. # Changed getopt to libiberty, commented out an aborted attempt at host
  704. # level Makefiles because it caused errors on +rm, add a warning for
  705. # directories expected to be removed on +rm but that don't exist.
  706. #
  707. # Revision 1.8  1991/04/24  16:50:59  rich
  708. # Three staging checkpoint.
  709. #
  710. # Revision 1.7  1991/04/17  01:34:47  rich
  711. # Added getopt for binutils, fixed problem with host dependancies in
  712. # configure.template.
  713. #
  714. # Revision 1.6  1991/04/16  00:18:44  rich
  715. # Now handles multiple hosts and targets.
  716. #
  717. # Revision 1.5  1991/04/15  23:43:44  rich
  718. # Now handles multiple hosts and targets.
  719. #
  720. # Revision 1.4  1991/04/13  02:11:03  rich
  721. # Config cut 3.  We now almost install a29k.
  722. #
  723. # Revision 1.3  1991/04/11  02:41:54  rich
  724. # Cut 2 config.  Subdirs.
  725. #
  726. #
  727. #
  728.  
  729. #
  730. # Local Variables:
  731. # fill-column: 131
  732. # End:
  733. #
  734.  
  735. # end of configure.template
  736.